#pragma once

#include <string>
#include <map>
#include <memory>

using namespace std;

#include "topcvt_buffer.hpp"
#include "topcvt_cfg.hpp"
#include "topcvt_policy_factory.hpp"

namespace topcvt
{
    class UnpackImp;
    class PackImp;
    class PolicyImp;

    typedef std::shared_ptr<UnpackImp>  UnpackImpPtr_t;
    typedef std::shared_ptr<PackImp>    PackImpPtr_t;
    typedef std::shared_ptr<PolicyImp>  PolicyImpPtr_t;

    class PolicyImp
    {
    private:
        UnpackImpPtr_t m_unpack;
        PackImpPtr_t m_pack;
        string m_policy_name;
    public:    
        PolicyImp(const string& );
        ~PolicyImp();
        const string& getPolicyType();

        PktObject&  unpack(PktObject& obj, ByteBuffer& message, PolicyCfg& policy, map<string, string>& atx);
        string      pack(PktObject& obj, PolicyCfg& policy, map<string, string>& atx);
        PackImpPtr_t   getPacker();
        UnpackImpPtr_t getUnpacker();
    };
};